package drone.basis.assist ;

import java.util.Date ;

import drone.basis.util.DateUtil ;

public class DateSegment
{

	private Date min ;

	private Date max ;

	public DateSegment ( )
	{
	}

	public DateSegment (
			String segment
	)
	{
		this.min = DateUtil.parse ( segment.split ( "-" ) [ 0 ] ) ;
		this.max = DateUtil.parse ( segment.split ( "-" ) [ 1 ] ) ;
	}

	public DateSegment (
			Date min ,
			Date max
	)
	{
		this.min = min ;
		this.max = max ;
	}

	public Boolean between (
			Date date
	)
	{
		if ( date.getTime ( ) >= min.getTime ( ) && date.getTime ( ) < max.getTime ( ) )
		{
			return true ;
		}

		return false ;
	}

	public Date getMin ( )
	{
		return min ;
	}

	public void setMin (
			Date min
	)
	{
		this.min = min ;
	}

	public Date getMax ( )
	{
		return max ;
	}

	public void setMax (
			Date max
	)
	{
		this.max = max ;
	}

	public String toString ( )
	{
		return DateUtil.format ( min ) + "-" + DateUtil.format ( max ) ;
	}

}
